package com.cmc.cloud.cmclink.doc.convert;

import com.cmc.cloud.cmclink.doc.api.document.req.so.sovo.sovo.SoCreateAndUpdateReqDTO;
import com.cmc.cloud.cmclink.doc.api.document.req.so.sovo.sovo.SoDetailCompareRespDTO;
import com.cmc.cloud.cmclink.doc.api.document.req.soamendapplyvo.SoAmendApplyCreateReqVO;
import com.cmc.cloud.cmclink.doc.api.document.req.soamendapplyvo.SoAmendApplyRespVO;
import com.cmc.cloud.cmclink.doc.api.document.req.soamendapplyvo.SoAmendApplyUpdateReqVO;
import com.cmc.cloud.cmclink.doc.entity.SoAmendApplyDO;
import com.cmc.cloud.cmclink.doc.vo.sovo.sovo.SoCreateAndUpdateReqVo;
import com.cmc.cloud.cmclink.doc.vo.sovo.sovo.SoDetailCompareRespVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 订舱修改申请审批表主 Convert
 *
 * @author 招商轮船-管理员
 */
@Mapper
public interface SoAmendApplyConvert {

    SoAmendApplyConvert INSTANCE = Mappers.getMapper(SoAmendApplyConvert.class);

    /**
     * 属性转换 convert
     *
     * @param bean
     * @return
     */
    SoAmendApplyDO convert(SoAmendApplyCreateReqVO bean);

    /**
     * 属性转换 convert
     *
     * @param bean
     * @return
     */
    SoAmendApplyDO convert(SoAmendApplyUpdateReqVO bean);

    /**
     * 属性转换 convert
     *
     * @param bean
     * @return
     */
    @Mapping(target = "createTimeString", source = "createTime", dateFormat = "yyyy-MM-dd HH:mm")
    @Mapping(target = "applyTimeString", source = "applyTime", dateFormat = "yyyy-MM-dd HH:mm")
    @Mapping(target = "approveTimeString", source = "approveTime", dateFormat = "yyyy-MM-dd HH:mm")
    SoAmendApplyRespVO convert(SoAmendApplyDO bean);

    /**
     * 属性转换 convert
     *
     * @param list
     * @return
     */
    List<SoAmendApplyRespVO> convertList(List<SoAmendApplyDO> list);

    /**
     * 属性转换 convert
     * @param dto dto
     * @return vo
     */
    SoCreateAndUpdateReqVo convert(SoCreateAndUpdateReqDTO dto);

    /**
     * 属性转换 convert
     * @param dto dto
     * @return vo
     */
    SoDetailCompareRespDTO convert(SoDetailCompareRespVo dto);

}
